#include "bits/stdc++.h"

using namespace std;

#define FOR_INC(i, start, end) for (int i = start; i < end; ++i)
#define FOR_DEC(i, start, end) for (int i = start; i > end; --i)
#define FOR_INC_EQUAL(i, start, end) for (int i = start; i <= end; ++i)
#define FOR_DEC_EQUAL(i, start, end) for (int i = start; i >= end; --i)
#define int long long

void getNums(string s){
    string t;
    for(char ch:s){
        if(ch=='['){
            t+='{';
        }else if(ch==']'){
            t+='}';
        }else{
            t+=ch;
        }
    }
    cout<<t<<endl;
}
class Fenwick {
    vector<int> f;

public:
    Fenwick(int n) : f(n) {}
    static int lowBit(int n){
        return n&-n;
    }
    void update(int i, int val) {
        for (; i < f.size(); i += lowBit(i)) {
            f[i] += val;
        }
    }

    int query(int i) {
        int res = 0;
        for (; i > 0; i -= lowBit(i)) {
            res += f[i];
        }
        return res;
    }

    void add(int i,int val){
        f[i]+=val;
    }

    int get(int index){
        return f[index];
    }
};

class UnionFind {
    std::vector<int> root;
    std::vector<int> rank;
public:
    explicit UnionFind(int size) {
        root.resize(size);
        rank.resize(size);
        for (int i = 0; i < size; ++i) {
            root[i] = rank[i] = i;
        }
    }

    int find(int x) {
        if (x == root[x])
            return x;
        return root[x] = find(root[x]);
    }

    void connect(int x, int y) {
        int rootX = find(x);
        int rootY = find(y);
        if (rootX != rootY) {
            if (rank[rootX] > rank[rootY]) {
                root[rootY] = rootX;
            } else if (rank[rootX] < rank[rootY]) {
                root[rootX] = rootY;
            } else {
                root[rootY] = rootX;
                rank[rootX] += 1;
            }
        }
    }

    bool isConnected(int x, int y) {
        return find(x) == find(y);
    }
};

class NumArray {

private:
    vector<int> nums_;
    Fenwick* fenwick_;
public:


    NumArray(vector<int>& nums) :nums_(nums){
        fenwick_ = new Fenwick(nums.size()+1);
        for(int i=1;i<=nums.size();i++){
            fenwick_->add(i,nums[i-1]);
            int index = Fenwick::lowBit(i)+i;
            if(index<=nums.size()){
                fenwick_->add(index,fenwick_->get(i));
            }
        }
    }

    int sumRange(int left, int right) {
        return fenwick_->query(right+1)-fenwick_->query(left);
    }
};

class KMP{
private:
    vector<vector<int>> dp;
    string pat_;
    int size = 128;

public:
    KMP(const string& pat){
        this->pat_ = pat;
        int n = pat.length();
        dp.resize(n,vector<int>(size,0));
        dp[0][pat[0]]=1;
        int pre = 0;
        for(int j=1;j<n;j++){
            for(int c=0;c<size;c++){
                dp[j][c] = dp[pre][c];
            }
            dp[j][pat[j]]=j+1;
            pre = dp[pre][pat[j]];
        }
    }

    int search(const string& txt){
        int M = pat_.size();
        int N = txt.size();
        int j = 0;
        for(int i=0;i<N;i++){
            j = dp[j][txt[i]];
            if(j==M){
                return i-M+1;
            }
        }
        return -1;
    }

    int fun(){
        int n = pat_.size();
        int ans = -1;
        for(int i=0;i<size;i++){
            ans = max(ans,dp[n-1][i]);
        }
        if(ans==n){
            return -1;
        }
        return ans;
    }
};
class Solution {
public:

};

signed main(){
//    Solution s;
//    vector<vector<int>> grid{{1,1},{9,9},{1,1}};
//    vector<int> nums{5,3,0,6,4,9,10,7,2,8};
    std::ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    std::cout.tie(nullptr);
    int n,m;
    cin>>n>>m;
    int x1,y1,x2,y2;
    vector<vector<int>> grid(n+1,vector<int>(n+2,0));
    for(int i=0;i<m;i++){
        cin>>x1>>y1>>x2>>y2;
        for(int j=x1;j<=x2;j++){
            grid[j][y1]++;
            grid[j][y2+1]--;
        }
    }
    int sum = 0;
    for(int i=1;i<=n;i++){
        for(int j=1;j<=n+1;j++){
            sum+=grid[i][j];
            if(j!=n+1)
                cout<<sum<<" ";
        }
        cout<<endl;
    }
    return 0;
}